Miles Sound System SDK 7.2a

Memory and File Services

Discussion

The Memory and File Services are cross-platform services to control memory allocation and file I/O. On some platforms, memory must be allocated correctly for MSS use:

On Win32 and Win64, you don't need to anything special to the memory - you can use normal memory.

On MacOS, you must call AIL_mem_alloc_lock and AIL_mem_free_lock to manage memory that will be passed into MSS.

On DOS, you must call AIL_mem_alloc_lock and AIL_mem_free_lock or you must call AIL_vmm_lock to lock addresses that will be passed into MSS.

Memory and File Services
AIL_mem_alloc_lock allocates a locked block of memory.
AIL_mem_free_lock frees a pointer previously allocated with AIL_mem_alloc_lock or AIL_file_read.
AIL_file_read loads a data file into the specified memory address, optionally allocating the memory as well.
AIL_file_fss_read loads a data file spec into the specified memory address, optionally allocating the memory as well.
AIL_file_write creates a new data file and fills it with the specified data.
AIL_file_fss_write creates a new MacOS data file spec and fills it with the specified data.
AIL_file_fss_attrib_write creates a new MacOS data file spec and fills it with the specified data.
AIL_WAV_file_write creates a new Microsoft .WAV file.
AIL_WAV_file_fss_write creates a new MacOS .WAV file spec.
AIL_file_size returns the size of the specified data file.
AIL_file_fss_size returns the size of the specified MacOS data file spec.
AIL_file_error returns the last file I/O error from AIL_file_read, AIL_file_write, or AIL_file_size.
MILES_FILE_ERRORS describes an error encountered by one of the Miles file I/O functions.
AIL_mem_use_malloc replaces the default memory allocation routines.
AIL_mem_use_free replaces the default memory freeing routine.
AILMALLOCCB specifies a pointer to a user-defined memory allocation callback.
AILFREECB specifies a pointer to a user-defined memory release callback.
AIL_set_file_callbacks replaces the synchronous (blocking) file I/O functions that Miles uses for AIL_file_read, AIL_file_size, and the high-level streaming functions.
AIL_set_file_async_callbacks replaces the file I/O handlers that Miles uses for its high-level streaming functions on certain platforms.
AIL_file_open_callback specifies a user-replaceable callback handler to open a file in MSS.
AIL_file_close_callback specifies a user-replaceable callback handler to close a file.
AIL_file_seek_callback specifies a user-replaceable callback handler to seek in a file.
MILES_FILE_SEEK_TYPE describes the type of seek to perform.
AIL_file_read_callback specifies a user-replaceable callback handler to read from a file.
AIL_file_async_read_callback specifies a user-replaceable callback handler to initiate asynchronous reads from a file.
AIL_file_async_status_callback specifies a user-replaceable callback handler to poll for completion of an asynchronous read.
AIL_vmm_lock locks the specified memory range under DOS.
AIL_vmm_unlock unlocks a piece of memory previously locked with AIL_vmm_lock.
AIL_vmm_lock_range locks the specified memory range under DOS.
AIL_vmm_unlock_range unlocks a piece of memory previously locked with AIL_vmm_lock_range.

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.